<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"></html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv=X-UA-Compatible content="IE=edge">
    <meta name=format-detection content="telephone=no">
    <meta name=format-detection content="email=no">
    <meta name=apple-mobile-web-app-capable content=yes>
    <meta name=apple-mobile-web-app-status-bar-style content=black>
    <meta name=full-screen content=yes><meta name=browsermode content=application>
    <meta name=x5-orientation content=portrait><meta name=x5-fullscreen content=true>
    <meta name=x5-page-mode content=app>
    <meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">

    <title>平台招商</title>
    <script th:src="@{/js/vue.min.js}"></script>
    <script th:src="@{/js/axios.min.js}"></script>
    <script th:src="@{/js/vue-lazyload.js}"></script>
    <script th:src="@{/js/index.js}"></script>
    <link rel="stylesheet" th:href="@{/css/index.css}">
</head>
<body>
<div id="content" >
    <section>
        <img v-for="item in imgArr" v-lazy="item.img" alt="">
    </section>
    <footer id="foot1">
        <div class="foot1-form clear">
            <div class="clear">
                <span class="foot1-form-input"><input id="name" type="text" placeholder="姓名" /></span>
            </div>
            <div class="clear">
                <span class="foot1-form-input"><input id="phone" type="tel" placeholder="手机号码" /></span>
            </div>
        </div>
        <p class="foot1-btn" @click="goSubmit">提交</p>
        <span class="foot1-text">注: 提交后我们会在24小时之内与您联系</span>
    </footer>
</div>
<script th:inline="javascript">
    var baseUrl = [[${baseUrl}]];
    console.log(baseUrl);
</script>
<script th:src="@{/js/jquery-2.1.1.js}"></script>
<script>
    var arr = {};
    Vue.use(VueLazyload,{
        // error:'./static/error.png',
        loading:'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/f98f4501-7c83-407c-b884-eac331306529.jpg'
    });
    var app = new Vue({
        el: '#content',
        data: {
            imgArr: [
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/7bb0ef86-8112-45fc-8749-ebeb0a822467.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/b38b2671-815e-4689-8fb3-ec5bd7ec3865.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/bf44ee40-1203-4247-9cfe-9dec55bcba05.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/66a444aa-5a60-47ff-8fd5-507fd34a003e.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/688a2ecd-bf79-4fff-87aa-bb2df04a2d01.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/98979665-d41b-4674-b972-6229397e91ed.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/35b67dc0-0ceb-4b2b-beb4-915a7a64c6e6.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/54c5d47d-0b58-43f1-a4f0-62ea5bd94cb7.jpg'},
                {img: 'https://luobo-jxs.oss-cn-hangzhou.aliyuncs.com/app/788f81df-9e65-4773-981e-d4501e97609e.jpg'}
            ],
            contents: {}
        },
        methods: {
        	goSubmit: function () {
        		if ((/^1[3|4|5|8][0-9]\d{4,8}$/.test($("#phone").val())) && $("#name").val() !== '') {
        			axios.post(baseUrl + 'platform/wap/app/customer/collect', {name:$("#name").val(),phone:$("#phone").val()
                    }).then(function (response) {
                    	if(response.data.code==20000)
                    		$("#foot1").css("display", "none");
                    	else
                    		alert(response.data.message);
                    }).catch(function (error) {
                        console.log(error);
                    });
                } else {
                    alert("请填写完成或输入正确的手机号码")
                }
            	
       
            }
        },
        created: function (){
            $("section").addClass($("footer").attr("id"))
        }
    });
</script>
</body>
</html>